package com.example.springboot.mapper;

import com.example.springboot.pojo.Department;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DepartmentMapper {

    @Select("select * from department")
    List<Department> getAllDepartment();

    @Insert("insert into department(department) values(#{department})")
    void addDepartment(String department);

    @Delete("delete from department where id=#{id}")
    void deleteDepartment(Integer id);

    @Update("update department set department=#{department} where id=#{id}")
    void updateDepartment(Integer id, String department);

    @Select("select * from department where department=#{department}")
    Department findDepartment(String department);
}
